<template>
  <v-layout title="每日明细详情">
    <el-row type="flex" justify="center">
      <el-col :lg="14" :md="18" :sm="24" class="confirm">

        <v-form
          ref="form1"
          :form-title="formTitle"
          :form-data="formData"
          label-width="120px"
        />
        <!--汇款银行信息-->
        <v-resetConfirmBtn
          @reset="reset"
          @confirm="confirm"
        />

      </el-col>
    </el-row>
  </v-layout>

</template>

<script>
  import {deepClone} from '@/utils'

  export default {
    data() {
      return {
        id: '',
        title: '',
        formTitle: [
          {
            cn: 'id',
            en: 'id',
            disabled:true
          },
          {
            cn: '日期',
            en: 'date',
            disabled:true
          },
          {
            cn: '公众号',
            en: 'mp_name',
            disabled: true
          },
          {
            cn: '消耗',
            en: 'cost',
          },
          {
            cn: '收益',
            en: 'earning',
          },
          {
            cn: '拼多多',
            en: 'pdd_earning',
          },
          {
            cn: '淘宝',
            en: 'taobao_earning',
          },
          {
            cn: '其他收益',
            en: 'other_income',
            disabled: true
          },
          {
            cn: '累计粉丝',
            en: 'fans_count',
            disabled: true
          },
          {
            cn: '新增粉丝',
            en: 'new_fans',
            disabled: true
          },
          {
            cn: '流失粉丝',
            en: 'lost_fans',
            disabled: true
          },
          {
            cn: '净增粉丝',
            en: 'net_increase_fans',
            disabled: true
          },
          {
            cn: '系统',
            en: 'use_system',
            disabled: true
          },
          {
            cn: '投放公司',
            en: 'launch_corp',
            disabled: true
          },
          {
            cn: '投放渠道',
            en: 'launch_channel',
            disabled: true
          },
          {
            cn: '单粉成本',
            en: 'per_fan_cost',
            disabled: true
          },
          {
            cn: '单粉收益',
            en: 'per_fan_earning',
            disabled: true
          },
        ],
        formData: {},
      }
    },
    activated() {
      this.id = this.$route.query.id
      this.name = this.$route.query.name
      this.formData = this.$route.query.details&&JSON.parse(this.$route.query.details)||{}
    },
    methods: {
      confirm(){
        const data = this.formData;
        this.$post('action/TaoMpDailyDetail/save',data)
            .then(res=>{
              this.$message({
                  message:res.msg,
                  type:'success'
              })
              this.back()
            })
      },
      reset(){

      },
      back() {
        this.$router.go(-1)
      },
    }
  }
</script>

<style scoped>
  span + button {
    margin-left: 15px;
  }

  .el-button + .el-button {
    margin-left: 15px

  }

  .flex {
    display: flex;
    flex-wrap: nowrap;
  }

  .label {
    width: 120px;
    padding-right: 12px;
    font-size: 14px;
    text-align: right;
    color: #606266;
    line-height: 30px;
  }

  .m0 {
    margin: 0;
  }
</style>
